let logger = require("pomelo-logger").getLogger(__filename);

module.exports = function (app) {
    return new Handler(app);
};

let Handler = function (app) {
    this.app = app;
};

Handler.prototype.getLeaderBoard = function (msg, session, callback) {
    if (!session.player) {
        logger.error("empty player");
        callback(null, {
            resultCode: 404,
            message: "请先登录"
        });
        return;
    }
    this.app.get("leaderBoardService").getLeaderBoard(session.player, msg, callback);
};